<template>
	<view>
		<button class="backpage" @click="lastPageFun">执行第一页函数</button>
		<button class="backpage" @click="execPagesMethods">执行多个页面函数</button>
		<button class="backpage" @click="execMethod">执行上一页函数</button>
		<button class="backpage" @click="execCurrentMethod">执行当前页函数</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			lastPageFun() {
				// uni.$router.trigger('自定义参数','pages/index/index') // 触发上一页event事件方法
				uni.$router.callAnyPageMethod('pages/index/index', 'publicTest', 1, 2, 3)
			},
			execMethod(){
				uni.$router.callAnyPageMethod('pages/demo/index', 'publicExecMethod', 1, 2, 3)
			},
			execPagesMethods() {
				uni.$router.callAnyPageMethods(['pages/demo/index', 'publicExecMethod', 1, 2, 3],['pages/login/index', 'publicLogin', 'login methods'])
			},
			execCurrentMethod() {
				uni.$router.callMethod('test', 1, 2, 3)
			},
			test(...arg) {
				console.log(arg);
				console.log('执行callMethod');
			}
		}
	}
</script>

<style>

</style>
